/*
 * @Description: 
 * @Author: Pengfei
 * @Date: 2021-09-26 18:04:24
 * @LastEditTime: 2021-09-28 15:42:29
 * @LastEditors: Pengfei
 */
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

import path from 'path'
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  css: {
      preprocessorOptions: {
          less: {
              javascriptEnabled: true,
          },
      },
  },
  resolve: {
    alias: {
      // src 目录路径
      '@': path.resolve(__dirname, 'src'),
      // 公共组件导入路径
      '@m': path.resolve(__dirname, 'src/components'),
      // 布局组件
      '@l': path.resolve(__dirname, 'src/layout'),
      // 页面view
      '@v': path.resolve(__dirname, 'src/views')
    }
  },
  server:{
    proxy:{
      '/api': {
        target: 'http://api.help.bj.cn/',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      },
    }
  },
  build:{
    outDir: 'dist'
  }
})
